import { $t } from '@/i18n'

/**
 * 注册表单验证
 */
const registerForm = {
    // 规则
    rules: [
        // , required, 'alphaDash' , 
        {name: ['required', 'betweenLength:6,40', 'alphaDash']},
        {password: ['required', 'betweenLength:6,40', 'alphaDash']},
        {password_confirmation: ['required', 'confirmed:password']},
        {type: ['required', 'in:genuis,boss']},
    ],

    // 属性的展示名称设置
    attribute: {
        name: $t('message.auth.name.text'),
        password: $t('message.auth.password.text'),
        password_confirmation: $t('message.auth.password_confirmation.text'),
        type: $t('message.auth.type.text'),
    },

    // 自定义错误，将覆盖默认错误提示
    messages: {
        name: {
            required: ':attribute必须填写',
        },
    }
}

export default registerForm